<?php

namespace app\admin\model;

use think\Model;

class Wish extends Model
{
    // 表名
    protected $name = 'wish';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    
    // 追加属性
    protected $append = [
        'type_r_text'
    ];
    

    
    public function getTypeRList()
    {
        return ['0' => __('Type_r 0'),'1' => __('Type_r 1'),'2' => __('Type_r 2'),'3' => __('Type_r 3'),'4' => __('Type_r 4'),'5' => __('Type_r 5'),'6' => __('Type_r 6'),'7' => __('Type_r 7'),'8' => __('Type_r 8')];
    }     


    public function getTypeRTextAttr($value, $data)
    {        
        $value = $value ? $value : $data['type_r'];
        $list = $this->getTypeRList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
